package com.superboo.base.exception;

import com.superboo.base.enums.ResultEnum;

/**
 * GirlException
 *  自定义异常处理
 *  注意要继承RuntimeException.spring框架只会对runtimeException类型的异常进行事物的回滚
 *  Exception 类型的spring事物不会回滚
 * @author peiran zhang
 * @date 2017/3/20
 */
public class GirlException extends RuntimeException {

    private Integer code;

    public GirlException(ResultEnum resultEnum){
        super(resultEnum.getMsg());
        this.code = resultEnum.getCode();
    }

    public GirlException(Integer code,String message) {
        super(message);
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
